import "./styles/tailwind.css";
// import "./assets/iconfont/iconfont.css";
import "./assets/remixicon/remixicon.css";
import "./assets/css/scrollbar.css";
import SlashAppContext, {GlobalApplicationConfiguration} from "@/context/SlashAppContext";
import "slash-layer/dist/style.css";
import Login from "@/views/login/Login.vue";

GlobalApplicationConfiguration.logoImg = "/default.jpeg";
GlobalApplicationConfiguration.logoName = "忽视了搭";
GlobalApplicationConfiguration.loginComponent = Login

async function bootstrap() {
  //const app = createApp(App);
  console.log("应用启动开始");
  await SlashAppContext.createApp(null);
  SlashAppContext.setAppConfig(
    {
      //http请求基础路径
      httpBaseUrl:'http://127.0.0.1:8080/api',//'http://127.0.0.1:8080/api',//
      //文件上传预览基础路径
      fileBaseUrl: "http://127.0.0.1:8080/api",
      fileUploadUri: window.sessionStorage.getItem("fileUploadUri") || "/resourceApp/resource/uploadFile",
      loginSuccessRouterPath: "/navigation/welcome",
      loginSuccessRouterTitle: "欢迎页",
      loginSuccessInnerOpen: true,
      loginPath: "/login"
    });
  await SlashAppContext.init();
  await SlashAppContext.routerReady();
  // await SlashAppContext.use(naive);
  // await SlashAppContext.use(SlashLayer, config);
  // 注册全局常用的 naive-ui 组件
  //setupNaive(app);

  // 注册全局自定义组件
  //setupCustomComponents();

  // 注册全局自定义指令，如：v-permission权限指令

  // 注册全局方法，如：app.config.globalProperties.$message = message
  //setupGlobalMethods(app);

  // 挂载状态管理
  // setupStore(SlashAppContext._app);

  //优先挂载一下 Provider 解决路由守卫，Axios中可使用，Dialog，Message 等之类组件
  // appProvider.mount("#appProvider", true);

  // 挂载路由
  //await setupRouter(SlashAppContext._app);

  // 路由准备就绪后挂载APP实例

  // app.mount("#app", true);

  await SlashAppContext.mount("#app", true);

}

void bootstrap();
